package 设计模式.结构型.Adapter适配器.Demo_3;//package 设计模式.结构型.Adapter适配器.Demo_3;
//
///**
// * 将请求交给某个Handler处理
// *
// * @author: 张从龙
// * time: 2022/8/13 17:26
// */
//public interface HandlerAdapter {
//    public boolean supports(Object handler);
//
//    public void handle(Object request);
//}
//
//// 多种适配器类
//// SimpleController-HandlerAdapter决定调用的Controller
//class SimpleHandlerAdapter implements HandlerAdapter {
//    @Override
//    public void handle(Object request) {
//        ((SimpleController) request).handleRequest();
//    }
//
//    @Override
//    public boolean supports(Object handler) {
//        return (handler instanceof SimpleController);
//    }
//}
//
//class HttpHandlerAdapter implements HandlerAdapter {
//    @Override
//    public void handle(Object handler) {
//        ((HttpController) handler).handleRequest();
//    }
//
//    @Override
//    public boolean supports(Object handler) {
//        return (handler instanceof HttpController);
//    }
//}
//
//class AnnotationHandlerAdapter implements HandlerAdapter {
//    @Override
//    public void handle(Object handler) {
//        ((AnnotationController) handler).handleRequest();
//    }
//
//    @Override
//    public boolean supports(Object handler) {
//        return (handler instanceof AnnotationController);
//    }
//}